package com.allwees.bs.c.module.security;

import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @author Daniel
 * @version 1.0.0
 * @since 2020/11/28 20:49
 */
class ResponsePrinter {
    static void write(HttpServletResponse response,String content) throws IOException {
        response.setStatus(HttpStatus.OK.value());
        response.setCharacterEncoding(StandardCharsets.UTF_8.name());
        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
        response.getWriter().write(content);
    }
}
